#ifndef _RETRO_DATAMANAGER
#define _RETRO_DATAMANAGER

namespace Retro
{
  namespace Data
  {
    enum DataType
    {
      DataNull = 0,
      DataInvalid,
      DataString,
      DataInteger,
      DataReal,
    };

    struct StoredData
    {
      DataType  type;

      union
      {
        PSTR    string;
        LONG    integer;
        DOUBLE  real;
      } data;
    };

    class DLLEXPORT DataManager
    {
    private:
      Generic::Vector<StoredData, 10> mBuffer;

    public:
      INL UINT        getSize() const
      {
        return mBuffer.getSize();
      }

      VOID            setSize(UINT iValue);

      INL const StoredData& getData(UINT iIndex) const
      {
        return mBuffer[iIndex];
      }

      VOID            setString(UINT iIndex, PCSTR iValue);
      VOID            setInt(UINT iIndex, LONG iValue);
      VOID            setReal(UINT iIndex, DOUBLE iValue);

      BOOL            save(PCTSTR iPath);
      BOOL            load(PCTSTR iPath);

      DataManager();
      ~DataManager();
    };
  }
}

#endif
